import nltk
from nltk.sentiment import SentimentIntensityAnalyzer

# 下载情感分析模型 (如果尚未下载)
nltk.download('vader_lexicon')

# 创建情感分析器
analyzer = SentimentIntensityAnalyzer()

# 分析文本的情感
text = "This is a great movie! I really enjoyed it."
scores = analyzer.polarity_scores(text)

# 打印情感得分
print(scores)